import { Component, OnInit } from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {BackApiService} from "../back-api.service";
import {SimplePendingTask, Tasks} from "../../shared/PendingTask";
import {PageTitleService} from "../page-title.service";

@Component({
  selector: 'app-pending-tasks',
  templateUrl: './pending-tasks.component.html',
  styleUrls: ['./pending-tasks.component.scss']
})
// 代办业务列表
export class PendingTasksComponent extends Tasks implements OnInit {

  pendingTasks:SimplePendingTask[];

  constructor(
    protected _router: Router,
    protected _pageTitle: PageTitleService,
    protected _routerActive: ActivatedRoute,
    protected _backApiService: BackApiService) {

    super(_router , _pageTitle,_routerActive,_backApiService);
  }

  title(): string { return '待办任务'}

  ngOnInit() {
    this.getPendingTasks();
  }

  getPendingTasks(): void {
    this._backApiService.getPendings().then((list) => {
      this.pendingTasks = list;
    });
  }
}
